import axiosInstance from '@/api/axiosInstance'
interface productListParams {
  name?: string
  code?: string
  category?: string
  cat_name?: string
  class?: string
  team_code?: string

  // 其他查询条件...
}

// 获取产品列表
export const getProductList = async (params?: productListParams) => {
  return axiosInstance.get('/admin/product', { params })
}

// 获取产品详情
export const getProductDetail = async (id: number) => {
  return axiosInstance.get(`/admin/product/${id}`)
}

// 更新产品
export const updateProduct = async (id: number, data: any) => {
  return axiosInstance.put(`/admin/product/${id}`, data)
}

// 创建产品
export const createProduct = async (data: any) => {
  return axiosInstance.post(`/admin/product/`, data)
}

//导出产品列表
export const exportProductList = async (params?: productListParams) => {
  return axiosInstance.get('/admin/product/export', { params, responseType: 'blob', timeout: 60000 })
}
